🕸️ Ada Research Browser

README-wordpress-log-scanner.md
← Back

WordPress Log Accessibility Scanner

Version: 1.0.0 Date: 2026-03-11

Overview

Automated security scanner that tests WordPress sites for publicly accessible log files. Detects information disclosure vulnerabilities where sensitive log files can be accessed without authentication.

Features

Usage

Scan Specific Sites

python3 wordpress-log-scanner.py --sites pickerel-pearson.com,lakelucernewi.org

Scan All Sites on Server

python3 wordpress-log-scanner.py --server peter

Output to JSON File

python3 wordpress-log-scanner.py --server peter --output /tmp/wp-log-scan.json

Quiet Mode (Errors Only)

python3 wordpress-log-scanner.py --sites example.com --quiet

Tested Log Paths

The scanner tests these common WordPress log file locations:

Debug Logs

CxQ Plugin Logs

WooCommerce Logs

Generic Error Logs

Security Plugin Logs

Backup Logs

Output Format

JSON Structure

{
  "scan_time": "2026-03-11T17:00:00.000000",
  "scanner_version": "1.0.0",
  "total_sites": 2,
  "vulnerable_sites": 1,
  "total_vulnerable_logs": 1,
  "sites": [
    {
      "domain": "example.com",
      "scan_time": "2026-03-11T17:00:00.000000",
      "status": "VULNERABLE",
      "vulnerable_logs": [
        {
          "path": "/wp-content/uploads/cxq-antispam-fallback.log",
          "url": "https://example.com/wp-content/uploads/cxq-antispam-fallback.log",
          "content_type": "text/plain",
          "severity": "MEDIUM"
        }
      ],
      "protected_logs": [
        "/wp-content/debug.log"
      ],
      "total_tested": 18
    }
  ]
}

Exit Codes

Integration

Hourly Security Scan

The scanner is integrated into hourly-security-scan.sh and runs every 6 hours:

# Runs at: 00:00, 06:00, 12:00, 18:00
python3 scripts/wordpress-log-scanner.py --server peter --output reports/wordpress-log-scan-*.json

Alert Conditions

Sends email alert if: - Any site has vulnerable_sites > 0 - Any log files return HTTP 200 (publicly accessible)

Compliance Scanner Integration

Can be integrated into compliance-scanner.py as a WordPress-specific check category.

Remediation

Create .htaccess in wp-content/uploads/:

# Protect log files from public access
<FilesMatch "\.(log)$">
  Order allow,deny
  Deny from all
</FilesMatch>

Deploy to affected site:

sudo cp .htaccess /home/brandon/web/SITE.com/public_html/wp-content/uploads/
sudo chown brandon:brandon /home/brandon/web/SITE.com/public_html/wp-content/uploads/.htaccess
sudo chmod 644 /home/brandon/web/SITE.com/public_html/wp-content/uploads/.htaccess

Alternative: Move Logs Outside Web Root

Better security - logs completely inaccessible:

# Move logs to /home/brandon/logs/
mkdir -p /home/brandon/logs/SITE.com

Update plugin configurations to log to /home/brandon/logs/SITE.com/ instead.

Testing

Verify Protection

# Should return HTTP 403 or 404
curl -I https://example.com/wp-content/uploads/debug.log

Test Scanner

# Test on known-good site
python3 wordpress-log-scanner.py --sites pickerel-pearson.com

# Should output:
# ✓ All sites secure - no publicly accessible log files found

Security Considerations

What This Scanner Detects

What This Scanner Does NOT Detect

False Positives

Maintenance

Adding New Log Paths

Edit LOG_PATHS list in wordpress-log-scanner.py:

LOG_PATHS = [
    # Add new path
    "/wp-content/custom-plugin/logs/debug.log",
    ...
]

Excluding Sites

Currently scans all sites on server. To exclude:

# Manual scan with specific sites only
python3 wordpress-log-scanner.py --sites site1.com,site2.com

History

Support

See main README.md for Cyber-Guardian documentation.